import http from '../../utils/request'
//图书查询接口
export const getBookPageData =(params) =>{
    return http.get('/book',
        {params}).then(reponse =>{
        return reponse.data.bookPassPage;
    }).catch(error => {
        console.error(error);
    });
}

export const delBook =(params) =>{
    var id = params.id;
    return http.post('/book/d/'+id).then(response =>{
        return response;
    })
}

export const addBook =(params) =>{
    return http.post('/book',params).then(response =>{
        return response;
    })
}

//图书查询接口
export const getBookListData =(params) =>{
    return http.get('/book/list',
        {params}).then(reponse =>{
        return reponse.data.bookList;
    }).catch(error => {
        console.error(error);
    });
}